<%
var headerPart = {
%>
<style>
	.layui-form-label{
		min-width: 135px!important;
	}
	.layui-input-inline{
		min-width: 400px!important;
	}
	html{background-color: #fff!important;}
</style>
<% }; %>
<% layout("/layouts/micro.html",{headerSection:headerPart}){ %>
<div class="childrenBody">
 	<div class="layui-tab-content">
		<form id="inputForm" modelAttribute="category" action="${ctx}/cms/category/save" method="post" class="layui-form">
			<input type="hidden" name="id" value="${category.id}"/>
			<#message content="${message!}"/>
			<div class="layui-form-item">
				<label class="layui-form-label" >归属机构:</label>
				<div class="layui-input-inline">
					 <#treeselect id="office" name="office.id" value="${category.office.id}" labelName="office.name" labelValue="${category.office.name}"
						title="机构" url="/sys/office/treeData" cssClass="required"/>
				</div>
				<div class="layui-form-mid "><font color="red">*</font> </div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >上级栏目:</label>
				<div class="layui-input-inline" >
					<#treeselect id="category" name="parent.id" value="${category.parent.id}" labelName="parent.name" labelValue="${category.parent.name}"
						title="栏目" url="/cms/category/treeData" extId="${category.id}" cssClass="required"/>
				</div>
				<div class="layui-form-mid "><font color="red">*</font> </div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >栏目模型:</label>
				<div class="layui-input-inline" >
					<select name="module">
						<option value="" label="公共模型"/>
						<#options items="${@DictUtils.getDictList('cms_module')}" value="${category.module}"/>
					</select>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >栏目名称:</label>
				<div class="layui-input-inline " >
					<input type="text" name="name" value="${category.name}" htmlEscape="false" maxlength="50" class="layui-input" lay-verify="required"/>
				</div>
				<div class="layui-form-mid "><font color="red">*</font> </div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >缩略图:</label>
				<div class="layui-input-inline">
					<input type="hidden" name="image" id="image" value="${category.image}" htmlEscape="false" maxlength="255" class="layui-input"/>
					<#ckfinder input="image" type="thumb" uploadPath="/cms/category" readonly="false" selectMultiple="false"/>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >链接:</label>
				<div class="layui-input-inline" >
					<input type="text" name="href" value="${category.href}" htmlEscape="false" maxlength="200" class="layui-input"/>
				</div>
				<div class="layui-form-mid layui-word-aux">栏目超链接地址，优先级“高”</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >目标:</label>
				<div class="layui-input-inline">
					<input type="text" name="target" value="${category.target}" htmlEscape="false" maxlength="200" class="layui-input"/>
				</div>
				<div class="layui-form-mid layui-word-aux">栏目超链接打开的目标窗口，新窗口打开，请填写：“_blank”</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >描述:</label>
				<div class="layui-input-block" style="margin-left: 165px;">
					<textarea name="description" htmlEscape="false" rows="4" maxlength="200" class="layui-textarea">${category.description}</textarea>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >关键字:</label>
				<div class="layui-input-inline">
					<input type="text" name="keywords" value="${category.keywords}" htmlEscape="false" maxlength="200" class="layui-input"/>
				</div>
				<div class="layui-form-mid layui-word-aux">填写描述及关键字，有助于搜索引擎优化</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >排序:</label>
				<div class="layui-input-inline">
					<input type="text" name="sort" value="${category.sort}" htmlEscape="false" maxlength="11" class="digits layui-input" lay-verify="required"/>
				</div>
				<div class="layui-form-mid "><font color="red">*</font> </div>
				<div class="layui-form-mid layui-word-aux">栏目的排列次序</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >在导航中显示:</label>
				<div class="layui-input-inline">
					<#radio name="inMenu" items="${@DictUtils.getDictList('show_hide')}" value="${category.inMenu}"/>
				</div>
				<div class="layui-form-mid layui-word-aux">是否在导航中显示该栏目</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >在分类页中显示列表:</label>
				<div class="layui-input-inline">
					<#radio name="inList" items="${@DictUtils.getDictList('show_hide')}" value="${category.inList}"/>
				</div>
				<div  class="layui-form-mid layui-word-aux">是否在分类页中显示该栏目的文章列表</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" title="默认展现方式：有子栏目显示栏目列表，无子栏目显示内容列表。" >展现方式:</label>
				<div class="layui-input-inline" style="width: 450px;">
					<#radio name="showModes" items="${@DictUtils.getDictList('cms_show_modes')}" value="${category.showModes}"/>
				</div>
				<div class="layui-form-mid layui-word-aux">有子栏目显示栏目列表，无子栏目显示内容列表。</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >是否允许评论:</label>
				<div class="layui-input-inline">
					<#radio name="allowComment" items="${@DictUtils.getDictList('yes_no')}" value="${category.allowComment}"/>
				</div>
				<div class="layui-form-mid layui-word-aux">有子栏目显示栏目列表，无子栏目显示内容列表。</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >是否需要审核:</label>
				<div class="layui-input-inline">
					<#radio name="isAudit" items="${@DictUtils.getDictList('yes_no')}" value="${category.isAudit}"/>
				</div>
				<div class="layui-form-mid layui-word-aux">有子栏目显示栏目列表，无子栏目显示内容列表。</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >自定义列表视图:</label>
				<div class="layui-input-inline">
					<select name="customListView">
						<option value="" label="默认视图"/>
						<%for(listview in listViewList){%>
						<option value="${listview}" <%if(category.customListView==listview){%>selected<%}%>>${listview}</option>
						<%}%>
					</select>
				</div>
				<div class="layui-form-mid layui-word-aux">自定义列表视图名称必须以"${category_DEFAULT_TEMPLATE}"开始</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >自定义内容视图:</label>
				<div class="layui-input-inline">
					<select name="customContentView">
						<option value="" label="默认视图"/>
						<%for(contentview in contentViewList){%>
						<option value="${contentview}" <%if(category.customContentView==contentview){%>selected<%}%>>${contentview}</option>
						<%}%>
					</select>
				</div>
				<div class="layui-form-mid layui-word-aux">自定义内容视图名称必须以"${article_DEFAULT_TEMPLATE}"开始</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" >自定义视图参数:</label>
				<div class="layui-input-inline">
					<input type="text" name="viewConfig" value="${category.viewConfig}" htmlEscape="true" class="layui-input"/>
				</div>
				<div class="layui-form-mid layui-word-aux">视图参数例如: {count:2, title_show:"yes"}</div>
			</div>

			<div class="layui-form-item layui-hide">
				<div class="layui-input-block">
					<%if(shiro.hasPermission("cms:category:edit")){%><button id="categoryForm" class="layui-btn" lay-filter="*" lay-submit>保 存</button><%}%>
					<button type="reset" class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
				</div>
			</div>
		</form>
	</div>
	</div>
<%}%>